import pymysql

DBHOST = 'localhost'
DBUSER = 'root'
DBPASS = '666666'
DBNAME = 'my_database'

try:
    db = pymysql.connect(host=DBHOST, user=DBUSER, password=DBPASS, database=DBNAME)
    cursor = db.cursor()
    print("Database connection successful!")
    db.close()
except Exception as e:
    print(f"Error connecting to database: {e}")